import type { RouteRecordRaw } from 'vue-router'

export const routers: RouteRecordRaw[] = [
  //首页
  {
    path: '/',
    name: 'admin',
    meta: {
      title: '后台首页',
    },
    component: () => import('~/layouts/index.vue'),
  },
  // 登录页面
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
    },
    component: () => import('~/pages/login/index.vue'),
  },
  //403页面
  {
    path: '/403',
    name: '403',
    component: () => import('~/pages/403/index.vue'),
    meta: {
      title: '403',
    },
  },
  // 404页面
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    meta: {
      title: '404',
    },
    component: () => import('~/pages/404/index.vue'),
  },
  //500服务器页面
  {
    path: '/500',
    name: '500',
    component: () => import('~/pages/500/index.vue'),
    meta: {
      title: '500',
    },
  },
]
// 动态路由
export const asyncRouters: RouteRecordRaw[] = [
  {
    path: '/',
    name: '/',
    meta: {
      title: '后台首页',
    },
    component: () => import('~/pages/home/index.vue'),
  },
  {
    path: '/goods/list',
    name: '/goods/list',
    meta: {
      title: '商品管理',
    },
    component: () => import('~/pages/goods/list.vue'),
  },
  {
    path: '/category/list',
    name: '/category/list',
    meta: {
      title: '分类列表',
    },
    component: () => import('~/pages/category/list.vue'),
  },
  {
    path: '/skus/list',
    name: '/skus/list',
    component: () => import('~/pages/skus/list.vue'),
    meta: {
      title: '规格管理',
    },
  },
  {
    path: '/coupon/list',
    name: '/coupon/list',
    component: () => import('~/pages/coupon/list.vue'),
    meta: {
      title: '优惠券列表',
    },
  },
  {
    path: '/user/list',
    name: '/user/list',
    component: () => import('~/pages/user/list.vue'),
    meta: {
      title: '用户列表',
    },
  },
  {
    path: '/level/list',
    name: '/level/list',
    component: () => import('~/pages/level/list.vue'),
    meta: {
      title: '会员等级',
    },
  },
  {
    path: '/order/list',
    name: '/order/list',
    component: () => import('~/pages/order/list.vue'),
    meta: {
      title: '订单列表',
    },
  },
  {
    path: '/comment/list',
    name: '/comment/list',
    component: () => import('~/pages/comment/list.vue'),
    meta: {
      title: '评价列表',
    },
  },
  {
    path: '/manager/list',
    name: '/manager/list',
    component: () => import('~/pages/manager/list.vue'),
    meta: {
      title: '管理员管理',
    },
  },

  {
    path: '/access/list',
    name: '/access/list',
    component: () => import('~/pages/access/list.vue'),
    meta: {
      title: '权限管理',
    },
  },
  {
    path: '/role/list',
    name: '/role/list',
    component: () => import('~/pages/role/list.vue'),
    meta: {
      title: '角色管理',
    },
  },
  {
    path: '/setting/base',
    name: '/setting/base',
    component: () => import('~/pages/setting/base.vue'),
    meta: {
      title: '基础设置',
    },
  },

  {
    path: '/setting/buy',
    name: '/setting/buy',
    component: () => import('~/pages/setting/buy.vue'),
    meta: {
      title: '交易设置',
    },
  },
  {
    path: '/setting/ship',
    name: '/setting/ship',
    component: () => import('~/pages/setting/ship.vue'),
    meta: {
      title: '物流设置',
    },
  },
  {
    path: '/distribution/index',
    name: '/distribution/index',
    component: () => import('~/pages/distribution/index.vue'),
    meta: {
      title: '分销员管理',
    },
  },
  {
    path: '/distribution/setting',
    name: '/distribution/setting',
    component: () => import('~/pages/distribution/setting.vue'),
    meta: {
      title: '分销设置',
    },
  },
  {
    path: '/image/list',
    name: '/image/list',
    component: () => import('~/pages/image/list.vue'),
    meta: {
      title: '图库列表',
    },
  },
  {
    path: '/notice/list',
    name: '/notice/list',
    component: () => import('~/pages/notice/list.vue'),
    meta: {
      title: '公告列表',
    },
  },
]
